<!--商品列表-->
<style scoped lang="less">
.list-goods-warp{
  padding-left: 0;
  padding-right: 0;
  &:focus,:hover {
    -webkit-tap-highlight-color:transparent;
  }
}
.list-goods-warp:active{
  background: #ffffff;
}
.scroller-wrap {
  top: 68px;
}
.pic {
  border: none;
}
.con {
  padding: 0 10px 10px 10px;
  border-bottom:1px solid #ebebeb;
}
.btn-grp {
  padding-top:10px;
  padding-right:10px;
  text-align: right;
}
.content-wrap {
  margin-top:68px;
  padding-bottom: 48px;
}
</style>

<template>
  <div>
    <div class="listhead-fix">
      <div class="m-sech-wrap mr20">
        <router-link :to="{path:'/search',query: { type: 'MedGoods'}}" class="m-sech-box displayflex">
          <i class="iconfont icon-search"></i>
          <div class="flex1 m-sech-ipt">
            <div class="txt">{{sechTxt || '输入商品名称'}}</div>
          </div>
        </router-link>
      </div>
    </div>

      <div class="content-wrap" v-if="commodities.length > 0">
        <div class="list-goods-warp" v-for="item in commodities">
          <div style="padding:10px; color:#333; font-size:16px; border-bottom:1px solid #ebebeb">
             {{item.GoodsName}}
          </div>
          <div class="displayflex con">
            <div class="pic">
              <img :src="item.PictContent | filterImg">
            </div>
            <div class="msg flex1">
							<p>商品编号：{{item.GoodsCode}}</p>
							<p>规格：{{item.GoodsSpec}}</p>
							<p>厂商：{{item.Producer}}</p>
            </div>
          </div>
          <div class="btn-grp">
            <div class="btn" v-on:click="goTo('Reg',item.productguid)">注册证</div>
            <div class="btn" v-on:click="goTo('Mac',item.ProducerGuid)">厂商证照</div>
            <!-- <div class="btn" v-on:click="goTo('Auth','Guid')">授权书</div>
            <div class="btn" v-on:click="goTo('Price','Guid')">物价</div> -->
          </div>
        </div>
      </div>
      <div class="noDate_page" v-else>
        <div class="noDate_icon"><i class="iconfont icon-null"></i></div>
        暂无数据！
      </div>
    <manage-footer :status='5'></manage-footer>
  </div>
</template>

<script>
import manageFooter from "@/components/core/footer/manage.footer.vue";
export default {
  name: 'GoodsList',
  components: {
    manageFooter
  },
  data() {
    return {
      sechTxt: '',
      commodities:[],
      PageIndex:1,
      PageSize:6,
      totalRecords:'',
      noMore:false,
      ScrollerConfig:{
        content: '上拉加载',
        downContent: '上拉加载',
        height: 0,
        loadingContent: '加载中...',
        upContent: '上拉加载',
      },
    };
  },
  watch: {
  },
  computed: {
    userinfo(){
      return localStorage.getItem('userinfo') === null?null:JSON.parse(localStorage.getItem('userinfo'));
    }
  },
  created() {
    this.sechTxt = sessionStorage.sechtxt;
    this.getData();
  },
  mounted() {
   
  },
  methods: {
    getData(){
      sessionStorage.removeItem('sechtxt');
       this.Ajax.post('wxh/excsupplier/'+this.$route.query.Guid+'/goods').then((resp) => {
        if (resp.errorCode == 0) {
          this.commodities = resp.data;
        } else {
          this.Toast({
            message: resp.message || '操作异常，请稍后重试',
          });
        };
      });
    },

    goTo(Page, Guid){
      this.$router.push({
        path: `/GoodsLic/${Page}`,
        query:{
          Guid:Guid
        }
      })
    },
  }
  
}
</script>
